package kr.hkit.androidcomplete01.ch07;

import kr.hkit.androidcomplete01.ch07.OffScreen.MyView;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Bundle;
import android.view.View;

public class Antialias extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new MyView(this));
	}

	class MyView extends View {

		private Paint paint;

		public MyView(Context context) {
			super(context);
			paint = new Paint();
		}

		@Override
		protected void onDraw(Canvas canvas) {
			canvas.drawColor(Color.LTGRAY);
			paint.setColor(Color.BLACK);
			paint.setTextSize(60);
			
			canvas.drawOval(new RectF(10,  10, 200, 120), paint);
			canvas.drawText("Text", 210, 70, paint);
			
			paint.setAntiAlias(true);
			canvas.drawOval(new RectF(10,  130, 200, 240), paint);
			canvas.drawText("Text", 210, 190, paint);
		}
	}

}
